/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package rentalcar.logic;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author klwul
 */
public class StartDatabase {

    Connection conn;

    public StartDatabase(){

    }


    public Connection getConnection(){
//        Connection conn = null;
        String driverName = "com.mysql.jdbc.Driver";
        String url = "jdbc:mysql://localhost:3306/";
        String databaseName = "rentacar_database";
        String userName = "root";
        String password = "claudiu89";
        try {
            Class.forName(driverName);
            conn = DriverManager.getConnection(url+databaseName, userName, password);
        } catch (ClassNotFoundException e) {
            e.getMessage();
        }catch (SQLException e){
            e.getSQLState();
        }
        

        return conn;
    }

}
